import React, {Component} from 'react'

export default class Hoc extends Component{

  render(){
    return (
      <div>
        <NewKkb stage="hello"></NewKkb>
      </div>
    )
  }


}

const withKKB = (Comp) => {
  const name = '组件'
  // return props => <Comp name={name} {...props}></Comp>
  return class extends React.Component {
    componentDidMount(){
      console.log('do something')
    }
    render () {
      return <Comp {...this.props} name={name} />
    }

  }


}

// pianai

const NewKkb = withKKB(kkb)

const withLog = Comp => {
  return props => <Comp {...props}></Comp>
}

function kkb (props) {
  return <div>{props.stage}-{props.name}</div>
}
